/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package pl.edu.amu.wmi.kino.visualjavafx.javafxcodegenerators.helpergenerators;

import pl.edu.amu.wmi.kino.visualjavafx.model.animation.transformations.WithBorder;

/**
 *
 * @author Admin
 */
public class WithBorderGenerator {
    public static String borderColorVarName="strokeParam";
    public static String borderWidthVarName="strokeWidthParam";

    public static void generateBorderVars(StringBuilder sb, WithBorder o,int recursionLevel){
        String rName=ColorVarsNameGenerator.getR(borderColorVarName, recursionLevel);
        String gName=ColorVarsNameGenerator.getG(borderColorVarName, recursionLevel);
        String bName=ColorVarsNameGenerator.getB(borderColorVarName, recursionLevel);

        sb.append("var "+rName+"="+o.getBorderColor().getRed()+";\n");
        sb.append("var "+gName+"="+o.getBorderColor().getGreen()+";\n");
        sb.append("var "+bName+"="+o.getBorderColor().getBlue()+";\n");
        sb.append("var "+borderWidthVarName+recursionLevel+"="+o.getBorderWidth()+";\n");
    }

    public static void generateBorderAttributes(StringBuilder sb,int recursionLevel){
        String rName=ColorVarsNameGenerator.getR(borderColorVarName, recursionLevel);
        String gName=ColorVarsNameGenerator.getG(borderColorVarName, recursionLevel);
        String bName=ColorVarsNameGenerator.getB(borderColorVarName, recursionLevel);

        sb.append("stroke:bind Color.rgb("+rName+","+gName+","+bName+");\n");
        sb.append("strokeWidth: bind "+borderWidthVarName+recursionLevel+";\n");
    }

}
